package com.cositas.dulces.lp.model;

import java.io.Serializable;

import com.cositas.dulces.lp.products.Products;

public class Product implements Serializable {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = -1811964617864274454L;
	
	public String product;
	public int quantity;
	public String details;
	
	public Product() {
		super();
	}

	public Product(Products product, int quantity, String details) {
		super();
		this.product = product.name();
		this.quantity = quantity;
		this.details = details;
	}

	@Override
	public String toString() {
		return "Product [product=" + product + ", quantity=" + quantity + ", details=" + details + "]";
	}
	
	public Products getProductEnum() {
		return Products.valueOf(Products.class, this.product);
	}
	
}
